package com.example.demo.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.entity.EavEntityType;
import com.example.demo.mapper.EavEntityTypeMapper;
import com.example.demo.service.EavEntityTypeService;
import org.springframework.stereotype.Service;

@Service
public class EavEntityTypeServiceImpl extends ServiceImpl<EavEntityTypeMapper, EavEntityType> implements EavEntityTypeService {
    @Override
    public EavEntityType selectByEntityModel(Long entityId, String entityModel) {
        LambdaQueryWrapper<EavEntityType> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(EavEntityType::getEntityModel, entityModel).eq(EavEntityType::getEntityId, entityId);
        return getOne(queryWrapper);
    }
}
